-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Import notes' images from revoked sharings #4339
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
taratatach
force-pushed
the
fix/import-revoked-shared-notes-images
branch
from
February 27, 2024 11:05
94302af
to
617580c
Compare
nono
reviewed
Feb 27, 2024
We'll want to add dependencies to the `note` model package in the `sharing` model package so we can't have existing dependencies the other way around or we'll end up with circular dependencies.
taratatach
force-pushed
the
fix/import-revoked-shared-notes-images
branch
from
February 27, 2024 14:55
617580c
to
4fc0d3c
Compare
Move the last implementation of `sharing.FileOpener` to the `sharing` model package now that we've moved the note opening logic to this package.
taratatach
force-pushed
the
fix/import-revoked-shared-notes-images
branch
from
February 27, 2024 15:10
4fc0d3c
to
3cb3a85
Compare
taratatach
changed the title
WIP: import images from notes (circular dependencies)
fix: Import notes' images from revoked sharings
Feb 27, 2024
nono
reviewed
Feb 27, 2024
taratatach
force-pushed
the
fix/import-revoked-shared-notes-images
branch
from
February 27, 2024 15:42
3cb3a85
to
ef24a76
Compare
nono
approved these changes
Feb 28, 2024
The `io.cozy.notes.images` documents associated with a Cozy Note are not shared with the note itself. Therefore, when the sharing is revoked and the note opened by the sharing recipient on their own Cozy (i.e. shared notes are opened on their creator's Cozy while the sharing is active), included images are shown as missing because we can't find their associated `io.cozy.notes.images` documents. However, the image binaries themselves are stored within the note's binary (which is an archive in this case) and thus can be imported on the recipient's Cozy as `io.cozy.notes.images` documents and the note content can be updated to reference these documents. After that, the images will be displayed as expected when opening the note.
Don't wait until the user tries to open a note from a revoked sharing to recreate its trigger but do it instead upon the sharing revocation.
taratatach
force-pushed
the
fix/import-revoked-shared-notes-images
branch
from
February 28, 2024 08:51
ef24a76
to
768c08d
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
io.cozy.notes.images
documents associated with a Cozy Note arenot shared with the note itself.
Therefore, when the sharing is revoked and the note opened by the
sharing recipient on their own Cozy (i.e. shared notes are opened on
their creator's Cozy while the sharing is active), included images are
shown as missing because we can't find their associated
io.cozy.notes.images
documents.However, the image binaries themselves are stored wihtin the note's
binary (which is an archive in this case) and thus can be imported on
the recipient's Cozy as
io.cozy.notes.images
documents and the notecontent can be updated to reference these documents.
After that, the images will be displayed as expected when opening the
note.